#include <unistd.h>
#include <pthread.h>
#include <signal.h>
#include <stdio.h>
#include <string.h>
#include <curses.h>
#include <stdlib.h>

int main( int argc, char *argv[] )
{
	int i;
	if(argc != 3 )
	{
		printf("Usage: root# ./ProcWrite [proc file name] [Data to write]\n");
		exit(0);
    }
	char buf[2048];
	FILE *fp;    

	if((fp=fopen(argv[1],"wb"))==NULL)
	{
		printf("Warning: File(%s) can not open.",argv[1]);
		exit(0);
	}
	strcpy(buf,argv[2]);
	fwrite(buf,1,strlen(buf),fp);
	fclose(fp);
}
